package com.zhentao.controller;

import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.pojo.core.ChargeStationComment;
import com.zhentao.model.pojo.core.ChargeStationGun;
import com.zhentao.model.pojo.core.ChargeStationInfo;
import com.zhentao.model.pojo.core.dto.ChargeCostDto;
import com.zhentao.model.pojo.core.dto.ChargeStationInfoDto;
import com.zhentao.model.pojo.core.param.ChargeStationInfoParam;
import com.zhentao.service.ChargeStationCommentService;
import com.zhentao.service.ChargeStationGunService;
import com.zhentao.service.ChargeStationInfoService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/auth/coregun")
public class ChargeCoreController {
    @Resource
    ChargeStationInfoService chargeStationInfoService;

    @Resource
    ChargeStationGunService chargeStationGunService;
    @Resource
    ChargeStationCommentService chargeStationCommentService;
    /**
     * @param
     * @return
     * 充电桩查询
     * WXQ
     */

    @PostMapping("/CoreList")
    public ResponseResult getCoreList(@RequestBody ChargeStationInfoDto chargeStationInfoDto) {
        return chargeStationInfoService.getCoreList(chargeStationInfoDto);
    }

    /**
     * @description  我的桩站查询
     * @author 振涛教育_小Q
     * @date    2025/1/5 1:33
      * @param param
     * @return
     */
    @PostMapping("/my/CoreList")
    public ResponseResult myCoreList(ChargeStationInfoParam param) {
        return chargeStationInfoService.myCoreList(param);
    }

    /**
     *
     * @param
     * @return
     * 充电枪
     * WXQ
     */
    @PostMapping("/CoreGunList")
    public ResponseResult getCoreGunList(@RequestBody ChargeStationInfoDto chargeStationInfoDto){
        return chargeStationGunService.getCoreGunList(chargeStationInfoDto);
    }

    /**
     *
     * @param
     * @return
     * 充电桩评论
     * WXQ
     */
    @PostMapping("/CoreCommentList")
    public ResponseResult getCoreCommentList(@RequestBody ChargeStationInfoDto chargeStationInfoDto){
        return chargeStationCommentService.getCoreCommentList(chargeStationInfoDto);
    }

    /**
     *
     * @param
     * @return
     * 充电桩评论添加
     * WXQ
     */
    @PostMapping("/CoreCommentAdd")
    public ResponseResult addCoreComment(@RequestBody ChargeStationComment chargeStationComment){
        return chargeStationCommentService.addCoreComment(chargeStationComment);
    }

    /**
     *
     * @param
     * @return
     * 获取单个充电枪
     * WXQ
     */
    @PostMapping("/CoreGetGun")
    public ResponseResult CoreGetGun(@RequestBody ChargeStationGun chargeStationGun){
        return chargeStationGunService.CoreGetGun(chargeStationGun);
    }
    /**
     *
     * @param
     * @return
     * 计算充电费用
     * WXQ
     */
    @PostMapping("/CoreCost")
    public ResponseResult CoreCost(@RequestBody ChargeCostDto chargeCostDto){
        return chargeStationGunService.CoreCalculate(chargeCostDto);
    }

    /**
     * 修改充电枪状态
     * @param
     * @return
     * WXQ
     */
    @PostMapping("/CoreGunStatus")
    public ResponseResult CoreGunUpdate(@RequestBody ChargeStationGun chargeStationGun){
        return chargeStationGunService.CoreGunUpdate(chargeStationGun);
    }

    /**
     * 解析二维码字符串转换为对象
     * @param
     * @return
     * WXQ
     */
    @PostMapping("/resolveQRCode")
    public ResponseResult resolveQRCode(@RequestBody String qrCode){
        return chargeStationGunService.resolveQRCode(qrCode);
    }
}
